home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 026-050 / scopedisk38 / ue24c / config!s < prev    next >
Text File  |  1995-03-18  |  12KB  |  318 lines

  1. ======== SPELLING CMDS ======
  2.  
  3. Start spell-checking mode by loading in the dictionary table.
  4. <rAmiga-1:  if (spellerUp) goto label(0)
  5.             if (not startSpell("Udtable","Udict",1)) {
  6.                 putMsg("No memory or dictionary not found")
  7.                 returnFalse
  8.             }
  9.             label(0)
  10.             putMsg("Speller is up") >
  11.  
  12. Find first misspelled word, starting at cursor.  Abort with Amiga-ESC.
  13. <rAmiga-2:      if (not spellerUp) {
  14.                     putMsg("Speller not up")
  15.                     returnFalse
  16.                 }
  17.                 putMsg(" ")
  18.                 if (not spell(curFile)) putMsg("Not in dict.") >
  19.  
  20. Spell-check from cursor fwd.  Mark bad words with "@".
  21. <rAmiga-3:      if (not runKey(rAmiga-1)) returnFalse
  22.                 putMsg("Spell checking ... abort with Amiga-ESC")
  23.                 while (not spell(curFile)) insertChar(curFile,"@") >
  24.  
  25. Load supplemental dictionary & spell from cursor fwd.  Add to supplement.
  26. <rAmiga-4:   if (not runKey(rAmiga-1)) returnFalse
  27.              equateNum(n54,curFile)
  28.              putMsg("Dict supplement to use (pmESC = UdSupplement)")
  29.              freebuf(buf54)
  30.              equateNum(n99,0)
  31.              if (inputString(buf54))  {
  32.                 if (not loadFile(buf54)) goto label(3)
  33.              } else {
  34. label(3)
  35.                 if (not loadFile("UdSupplement")) {
  36.                     if (not newFile) {
  37.                         putMsg("Close a file for me!")
  38.                         returnFalse
  39.                     }
  40.                     setFileName(curfile,"UdSupplement")
  41.                 }
  42.              }
  43.              putMsg("Spell checking ... abort with Amiga-ESC")
  44.              if (getFlag(curFile,searchCaps)) flipFlag(curFile,searchCaps)
  45. label(0)
  46.              while (not spell(buf[n54])) {
  47.                 moveCursor(buf[n54],sWord)
  48.                 freeBuf(buf54)
  49.                 insertRgn(buf54,eFile,buf[n54],word)
  50.                 moveCursor(buf[n54],eWord)
  51.                 moveCursor(buf54,sFile)
  52.                 if (not is(buf54,"'")) if (not is(buf54,alpha)) goto label(0)
  53.                 moveCursor(buf54,eFile)
  54.                 
  55.                 putMsg(buf54)                 .. remove for faster speed
  56.                 
  57.                 insertChar(buf54,eLine)
  58.                 moveCursor(curFile,eFile)
  59.  
  60. label(4)        .. could remove this block but it helps hugely in speed.
  61.                 setSearch(buf54)
  62.                 if (search(curFile,locA,locB,-1)) {
  63.                     if (is(curFile,sWord)) goto label(0)
  64.                     moveCursor(curFile,sWord)
  65.                     goto label(4)
  66.                 }
  67.                 moveCursor(buf54,sChar)
  68.                 clearChar(buf54) .. remove eline
  69.                 
  70.                 ..  this sect for speed
  71.                 moveCursor(buf54,sFile)
  72.                 copyChar(buf54,n47)      .. copy 1st char of word
  73.                 freeBuf(buf52)
  74.                 insertChar(buf52,eLine)  .. load in eline-1stchar
  75.                 insertChar(buf52,n47)
  76.                 moveCursor(curFile,eFile).. search for starting place
  77.                 setSearch(buf52)
  78.                 search(curfile,locA,locB,-1)
  79.                 moveCursor(curFile,eWord).. move fwd, so sWord works
  80.                 
  81.                 if (is(curFile,sFile)) goto label(1)
  82.                 while (nothing) {
  83.                     moveCursor(curFile,sWord)
  84.                     freeBuf(buf53)
  85.                     insertRgn(buf53,eFile,curFile,word)
  86.                     stringComp(n53,buf54,buf53,1)       .. ignore case
  87.                     if (eqNum(n53,0)) goto label(0)     .. found it, continue
  88.                     if (gtNum(n53,0)) {
  89. label(1)
  90.                         moveCursor(curFile,eWord)
  91.                         moveCursor(curFile,eChar)
  92. label(2)
  93.                         insertRgn(curFile,atCursor,buf54,all)
  94.                         insertChar(curFile,eLine)
  95.                         updateDisplay                 .. remove for faster speed
  96.                         incNum(n99)
  97.                         if (gtNum(n99,19)) {
  98.                             fileSize(curFile,n99)  .. force buffer packing
  99.                             equateNum(n99,0)
  100.                         }
  101.                         goto label(0)
  102.                     }
  103.                     if (is(curFile,sFile)) goto label(2)
  104.                 }
  105.             }
  106.             moveCursor(curFile,sFile)
  107.             putMsg("These words weren't in dictionary")
  108.             .. stopSpell       .. use if want speller removed
  109.             >
  110.  
  111. Merge dict supplement with dict-files.  dict.A-Z must be in Current Directory.
  112. <rAmiga-5:  if (isEmpty(curFile)) returnFalse
  113.             moveCursor(curFile,sFile)
  114.             freeBuf(buf52)
  115.             freeBuf(buf54)
  116.             insertRgn(buf54,eFile,"dict. ",all)
  117.             if (getFlag(curFile,searchCaps)) flipFlag(curFile,searchCaps)
  118.             equateNum(n50,0)
  119.             while (nothing) {
  120.                 moveCursor(curFile,eWord)
  121.                 moveCursor(curFile,sWord)
  122.                 freeBuf(buf53)
  123.                 if (not insertRgn(buf53,eFile,curFile,word)) {
  124. label(6)
  125.                         if (getFlag(buf52,changed)) saveFile(buf52)
  126.                         goto label(0)
  127.                 }
  128.                 moveCursor(buf53,sFile)
  129.                 toUpper(buf53)
  130.                 copyChar(buf53,n54)   .. copy 1st letter of word A-Z
  131.                 toLower(buf53)
  132.                 if (eqNum(n54,39)) equateNum(n54,65)  .. apost becomes 'A'
  133.                 else {
  134.                     if (gtNum(n54,90)) goto label(1)  .. must be A-Z
  135.                     if (gtNum(65,n54)) goto label(1)
  136.                 }
  137.                 moveCursor(buf54,eFile)
  138.                 moveCursor(buf54,sChar)
  139.                 swapChar(buf54,n54) .. make it "dict.A" etc.
  140.                 
  141.                 if (not eqNum(n54,n50)) {
  142.                     if (not eqNum(n50,0)) 
  143.                         if (getFlag(buf52,changed)) saveFile(buf52)
  144.                     clearRgn(buf52,all)
  145.                     fileSize(buf52,n49) .. make it pack buffer
  146.                     if (not insertFile(buf52,eFile,buf54)) {
  147.                     putMsg("Can't find dict.A-Z!")
  148.                         returnFalse
  149.                     }
  150.                     setFileName(buf52,buf54)
  151.                     if (getFlag(buf52,changed)) flipFlag(buf52,changed)
  152.                     equateNum(n50,n54)  .. save dict-letter
  153.                 }
  154.                 .. put word in dict.
  155.                 moveCursor(buf53,eFile)
  156.                 putMsg(buf53)
  157.                 insertChar(buf53,eLine)
  158.                 moveCursor(buf52,eFile)
  159. label(2)
  160.                 setSearch(buf53)
  161.                 if (search(buf52,locA,locB,-1)) {
  162.                     if (is(buf52,sWord)) goto label(1)
  163.                     goto label(2) .. continue searching
  164.                 }
  165.                 .. didn't find it.  Do the slow scan & insert the word.
  166.                 moveCursor(buf53,eFile)
  167.                 moveCursor(buf53,sChar)
  168.                 clearChar(buf53) .. remove eLine
  169.                 moveCursor(buf52,eFile)
  170.                 equateNum(n49,1)
  171. label(4)
  172.                 while (nothing) {
  173.                     if (eqNum(n49,1)) do(n48,1,40) moveCursor(buf52,sWord)
  174.                     moveCursor(buf52,sWord)
  175.                     freeBuf(buf51)
  176.                     insertRgn(buf51,eFile,buf52,word)
  177.                     stringComp(n53,buf53,buf51,1)       .. ignore case
  178.                     if (eqNum(n53,0)) goto label(1)     .. found it, continue
  179.                     if (gtNum(n53,0)) {
  180.                         if (eqNum(n49,1)) goto label(5)
  181.                         moveCursor(buf52,eWord)
  182.                         moveCursor(buf52,eChar)
  183. label(3)
  184.                         insertRgn(buf52,atCursor,buf53,all)
  185.                         insertChar(buf52,eLine)
  186.                         goto label(1)
  187.                     }
  188.                     if (is(buf52,sFile)) {
  189.                         if (eqNum(n49,1)) {
  190. label(5)
  191.                             equateNum(n49,0)
  192.                             do (n48,1,41) moveCursor(buf52,eWord)
  193.                             goto label(4)
  194.                         }
  195.                         goto label(3)
  196.                     }
  197.                 }
  198.  
  199. label(1) .. next word
  200.                 moveCursor(curFile,eLine)
  201.                 moveCursor(curFile,eChar)
  202.                 updateDisplay
  203.                 if (is(curFile,eFile)) goto label(6)
  204.             }
  205. label(0)
  206.             putMsg("Done.  Run Udbuild to rebuild working dict & table")
  207.             freeBuf(buf52)
  208. >
  209.  
  210. Remove words from dict-files.  dict.A-Z must be in Current Directory.
  211. <rAmiga-6:  if (isEmpty(curFile)) returnFalse
  212.             moveCursor(curFile,sFile)
  213.             freeBuf(buf52)
  214.             freeBuf(buf54)
  215.             insertRgn(buf54,eFile,"dict. ",all)
  216.             if (getFlag(curFile,searchCaps)) flipFlag(curFile,searchCaps)
  217.             equateNum(n50,0)
  218.             while (nothing) {
  219.                 moveCursor(curFile,eWord)
  220.                 moveCursor(curFile,sWord)
  221.                 freeBuf(buf53)
  222.                 if (not insertRgn(buf53,eFile,curFile,word)) {
  223. label(6)
  224.                         if (getFlag(buf52,changed)) saveFile(buf52)
  225.                         goto label(0)
  226.                 }
  227.                 moveCursor(buf53,sFile)
  228.                 toUpper(buf53)
  229.                 copyChar(buf53,n54)   .. copy 1st letter of word A-Z
  230.                 toLower(buf53)
  231.                 if (eqNum(n54,39)) equateNum(n54,65)  .. apost becomes 'A'
  232.                 else {
  233.                     if (gtNum(n54,90)) goto label(1)  .. must be A-Z
  234.                     if (gtNum(65,n54)) goto label(1)
  235.                 }
  236.                 moveCursor(buf54,eFile)
  237.                 moveCursor(buf54,sChar)
  238.                 swapChar(buf54,n54) .. make it "dict.A" etc.
  239.                 
  240.                 if (not eqNum(n54,n50)) {
  241.                     if (not eqNum(n50,0)) 
  242.                         if (getFlag(buf52,changed)) saveFile(buf52)
  243.                     clearRgn(buf52,all)
  244.                     fileSize(buf52,n49) .. make it pack buffer
  245.                     if (not insertFile(buf52,eFile,buf54)) {
  246.                         putMsg("Can't find dict.A-Z!")
  247.                         returnFalse
  248.                     }
  249.                     setFileName(buf52,buf54)
  250.                     if (getFlag(buf52,changed)) flipFlag(buf52,changed)
  251.                     equateNum(n50,n54)  .. save dict-letter
  252.                 }
  253.                 .. remove word from dict.
  254.                 moveCursor(buf53,eFile)
  255.                 putMsg(buf53)
  256.                 insertChar(buf53,eLine)
  257.                 moveCursor(buf52,eFile)
  258. label(2)
  259.                 setSearch(buf53)
  260.                 if (search(buf52,locA,locB,-1)) {
  261.                     if (is(buf52,sWord)) {
  262.                         clearRgn(buf52,loc)
  263.                         goto label(1) .. next word
  264.                     }
  265.                     goto label(2) .. continue searching
  266.                 }
  267.  
  268. label(1) .. next word
  269.                 moveCursor(curFile,eLine)
  270.                 moveCursor(curFile,eChar)
  271.                 if (is(curFile,eFile)) goto label(6)
  272.                 updateDisplay
  273.             }
  274. label(0)
  275.             putMsg("Done.  Run Udbuild to rebuild working dict & table")
  276.             freeBuf(buf52)
  277. >
  278.  
  279. Stop spell-checking mode.  (Frees up about 12k of memory.)
  280. <rAmiga-8:   if (spellerUp) { stopSpell putMsg("Speller removed") } >
  281.  
  282. ========== Split Windows =========
  283.  
  284. Remove current split window
  285. <lAmiga-0:  splitWindow(curFile,0)>
  286.  
  287. Split window to show current file
  288. <lAmiga-c:  splitWindow(curFile,splitSize)>
  289.  
  290. Split window to show Undo buffer
  291. <lAmiga-1:  splitWindow(buf45,splitSize)>
  292.  
  293. Split window to show search buffer
  294. <lAmiga-2:  splitWindow(buf49,splitSize)>
  295.  
  296. Split window to show replace buffer
  297. <lAmiga-3:  splitWindow(buf48,splitSize)>
  298.  
  299. Split window to show copied-hilite buffer
  300. <lAmiga-4:  splitWindow(buf47,splitSize)>
  301.  
  302. Split window to show copied-invert buffer
  303. <lAmiga-5:  splitWindow(buf46,splitSize)>
  304.  
  305. Split window to show copied-columnar buffer
  306. <lAmiga-6:  splitWindow(buf37,splitSize)>
  307.  
  308. Split window to show directory names
  309. <lAmiga-7:  splitWindow(buf38,splitSize) >
  310.  
  311. Set split window size
  312. <lAmiga-8: putMsg("# lines in split window (2 or more):")
  313.            if (inputNum(n54)) if (geNum(n54,2)) equateNum(splitSize,n54)
  314.            putMsg(" ")>
  315. Switch to next window split
  316. <lAmiga-9: toggle(windowSplit)>
  317.  
  318.